package com.book.book.service.impl;

import com.book.iphone.domain.CateBook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.book.book.dao.BookDao;
import com.book.book.domain.BookDO;
import com.book.book.service.BookService;



@SuppressWarnings("SpringJavaAutowiringInspection")
@Service
public class BookServiceImpl implements BookService {
	@Autowired
	private BookDao bookDao;
	
	@Override
	public BookDO get(Integer ubId){
		return bookDao.get(ubId);
	}
	
	@Override
	public List<BookDO> list(Map<String, Object> map){
		return bookDao.listWithName(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return bookDao.count(map);
	}
	
	@Override
	public int save(BookDO book){
		return bookDao.save(book);
	}
	
	@Override
	public int update(BookDO book){
		return bookDao.update(book);
	}
	
	@Override
	public int remove(Integer ubId){
		return bookDao.remove(ubId);
	}
	
	@Override
	public int batchRemove(Integer[] ubIds){
		return bookDao.batchRemove(ubIds);
	}

	@Override
	public List<BookDO> listWithName(Map<String, Object> map){
		return bookDao.listWithName(map);
	}

	/**
	 * 根据图书分类查书
	 * @param cateid
	 * @return
	 */
	@Override
	public List<BookDO> getcateid(Integer cateid) {
       return bookDao.getcateid(cateid);
	}

	/**
	 *
	 * @return
	 */
	@Override
	public List<CateBook> selectBookListWithCate() {
		return bookDao.selectBookListWithCate();
	}
}
